package cn.com.infcn.monitor.timertask;

import java.io.File;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

import cn.com.infcn.monitor.util.IFCDateUtils;
import cn.com.infcn.monitor.util.IFCMonitorConstanst;

public class MonitorLogTask {

	public void startup() {
		MonitorLogThread thread = new MonitorLogThread();
		
		ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
		// 第二个参数为首次执行的延时时间，第三个参数为定时执行的间隔时间
		service.scheduleAtFixedRate(thread, IFCDateUtils.getNextMinIntervalMs(), IFCMonitorConstanst.monitorInterval * 1000, TimeUnit.MILLISECONDS);
	}

	public static void main(String[] args) throws InterruptedException {
		IFCMonitorConstanst.dataPath="d:"+File.separator+"data"+File.separator;
		MonitorLogTask t = new MonitorLogTask();
		t.startup();
	}

	
}
